<?php
	
class Table_Nationalites extends Zend_Db_Table_Abstract
{
    protected $_name    = 'nationalite';
    protected $_primary = 'NATIONALITE_NUMERO';
    protected $_sequence = true; //la table a un autoincrément
    
    // Fonction permettant de recuperer toutes les nationalites
    public function getAllNationalites()
	{
		return $this->fetchAll($this->select()
									-> order ('NATIONALITE_NUMERO')
							   ) ;
	} 	
	
	// Fonction permettant de recuperer le nombre de nationalites
	public function getNbNationalites()
	{
		return $this->fetchRow($this->select()
									-> from ($this, array ('total'=>'COUNT(*)'))
							   ) ;
	}
	
	// Fonction permettant de recuperer la nationalite d'un VIP
	public function getNationaliteByNum($num)
	{
		return $this->fetchRow($this->select()
									-> where('NATIONALITE_NUMERO = ?',$num)
							   ) ;
	}
	

}